import request from '@/utils/request';
import { AxiosPromise } from 'axios';

/**
 * 查询联系人合作伙伴列表
 * @param query
 * @returns {*}
 */

export const listLead = (query?: LeadVO): AxiosPromise<LeadVO[]> => {
  return request({
    url: '/hrp/lead/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询联系人合作伙伴详细
 * @param id
 */
export const getLead = (id: number): AxiosPromise<LeadVO> => {
  return request({
    url: '/hrp/lead/' + id,
    method: 'get'
  });
};

/**
 * 新增联系人合作伙伴
 * @param data
 */
export const addLead = (data: LeadVO) => {
  return request({
    url: '/hrp/lead',
    method: 'post',
    data: data
  });
};

/**
 * 修改联系人合作伙伴
 * @param data
 */
export const updateLead = (data: LeadVO) => {
  return request({
    url: '/hrp/lead',
    method: 'put',
    data: data
  });
};
export const remarklistLead = (query?: LeadVO): AxiosPromise<LeadVO[]> => {
  return request({
    url: '/hrp/lead/list',
    method: 'get',
    params: query
  });
};

/**
 * 删除联系人合作伙伴
 * @param id
 */
export const delLead = (id: number | Array<number>) => {
  return request({
    url: '/hrp/lead/' + id,
    method: 'delete'
  });
};
export const execLead = (data: LeadVO) => {
  return request({
    url: '/hrp/lead/execLead',
    method: 'put',
    data: data
  });
};
export const GetCommentListlead = (query?: LeadVO): AxiosPromise<LeadVO[]> => {
  return request({
    url: '/hrp/lead/getCommentList',
    method: 'get',
    params: query
  });
};

export interface LeadVO extends BaseEntity {
  /** id */
  id?: number;

  /** 名称 */
  name?: string;

  /** 编码 */
  code?: string;

  /** 性别 */
  sex?: string;

  /** 手机号 */
  mobile?: string;

  /** 状态 */
  status?: string;

  /** 固定电话 */
  telephone?: string;

  /** 邮箱 */
  email?: string;

  /** 标识 */
  logo?: string;

  /** 网站地址 */
  website?: string;

  /** 信用编码 */
  idCard?: number;

  /** 成立日期 */
  salesId?: string;

  /** 评分 */
  deptId?: string;
  /** 地址 */
  source?: string;

  /** 是否客户 */
  stage?: string;

  /** 是否供应商 */
  lostReason?: string;
  partnerName?: string;
  /** 图片 */
  nextTime?: string;
  customerName?: string;
  /** 备注 */
  remark?: string;


}
